﻿using University.Workshop.Model;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using University.Workshop.Model.CardGame;

namespace University.Workshop.Tests
{
    
    
    /// <summary>
    ///This is a test class for TableTest and is intended
    ///to contain all TableTest Unit Tests
    ///</summary>
    [TestClass()]
    public class TableTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for NextDealer
        ///</summary>
        [TestMethod()]
        public void NextDealerTest()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            target.NextDealer();            
        }

        /// <summary>
        ///A test for Table Constructor
        ///</summary>
        [TestMethod()]
        public void TableConstructorTest()
        {
            Table target = new Table();            
        }

        /// <summary>
        ///A test for DecreaseMyChips
        ///</summary>
        [TestMethod()]
        public void DecreaseMyChipsTest()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            target.DecreaseMyChips();            
        }

        /// <summary>
        ///A test for GetMinimum
        ///</summary>
        [TestMethod()]
        public void GetMinimumTest()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            target.Chips[0] = "23";
            target.Chips[1] = "5";
            target.Chips[2] = "4";
            target.Chips[3] = "3";
            target.Chips[4] = "1";
            target.Users = 5;
            long expected = 1; // TODO: Initialize to an appropriate value
            long actual;
            actual = target.GetMinimum;
            Assert.AreEqual(expected, actual);            
        }

        /// <summary>
        ///A test for Next
        ///</summary>
        [TestMethod()]
        public void NextTest()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            target.Next();            
        }

        /// <summary>
        ///A test for NextCard
        ///</summary>
        [TestMethod()]
        public void NextCardTest()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            target.NextCard();            
        }

        /// <summary>
        ///A test for NextTurn
        ///</summary>
        [TestMethod()]
        public void NextTurnTest()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            target.NextTurn();            
        }

        /// <summary>
        ///A test for OnlyOneOnTable
        ///</summary>
        [TestMethod()]
        public void OnlyOneOnTableTest()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            bool expected = false; // TODO: Initialize to an appropriate value
            bool actual;
            actual = target.OnlyOneOnTable();
            Assert.AreEqual(expected, actual);            
        }

        /// <summary>
        ///A test for OnlyOneOnTable
        ///</summary>
        [TestMethod()]
        public void OnlyOneOnTableTest1()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            bool expected = false; // TODO: Initialize to an appropriate value
            bool actual;
            target.Users = 3;
            target.States[0] = true;
            target.States[1] = true;
            target.States[2] = true;
            actual = target.OnlyOneOnTable();
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for PullCard
        ///</summary>
        [TestMethod()]
        public void PullCardTest()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            Card expected = null; // TODO: Initialize to an appropriate value
            Card actual;
            actual = target.PullCard();
            expected = actual;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for PullTableCard
        ///</summary>
        [TestMethod()]
        public void PullTableCardTest()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            Card expected = null; // TODO: Initialize to an appropriate value
            Card actual;
            actual = target.PullTableCard();
            expected = actual;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for PullTableCard
        ///</summary>
        [TestMethod()]
        public void PullTableCardTest1()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            Card expected = null; // TODO: Initialize to an appropriate value
            Card actual;            
            actual = target.PullTableCard();
            actual = target.PullTableCard();
            actual = target.PullTableCard();
            actual = target.PullTableCard();
            actual = target.PullTableCard();            
            expected = actual;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Reset
        ///</summary>
        [TestMethod()]
        public void ResetTest()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            target.Reset();            
        }

        /// <summary>
        ///A test for ResetCardNumber
        ///</summary>
        [TestMethod()]
        public void ResetCardNumberTest()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            target.ResetCardNumber();            
        }

        /// <summary>
        ///A test for ResetStates
        ///</summary>
        [TestMethod()]
        public void ResetStatesTest()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            target.ResetStates();            
        }

        /// <summary>
        ///A test for ResetStates
        ///</summary>
        [TestMethod()]
        public void ResetStatesTest1()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            target.Users = 5;
            target.ResetStates();
        }

        /// <summary>
        ///A test for ResetTurn
        ///</summary>
        [TestMethod()]
        public void ResetTurnTest()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            target.ResetTurn();            
        }

        /// <summary>
        ///A test for SetLastBet
        ///</summary>
        [TestMethod()]
        public void SetLastBetTest()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            string value = string.Empty; // TODO: Initialize to an appropriate value
            target.SetLastBet(value);            
        }

        /// <summary>
        ///A test for SetStatus
        ///</summary>
        [TestMethod()]
        public void SetStatusTest()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            bool newStatus = false; // TODO: Initialize to an appropriate value
            target.SetStatus(newStatus);            
        }

        /// <summary>
        ///A test for SetState
        ///</summary>
        [TestMethod()]
        public void SetStateTest()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            int index = 0; // TODO: Initialize to an appropriate value
            bool state = false; // TODO: Initialize to an appropriate value
            target.SetState(index, state);            
        }

        /// <summary>
        ///A test for GetStartName
        ///</summary>
        [TestMethod()]
        public void GetStartNameTest()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            string actual;
            actual = target.GetStartName;            
        }

        /// <summary>
        ///A test for GetOnlyOneUserInTable
        ///</summary>
        [TestMethod()]
        public void GetOnlyOneUserInTableTest()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            target.Users = 2;
            target.SetState(0, false);
            target.SetState(1, true);
            
            int expected = 1; // TODO: Initialize to an appropriate value
            int actual;
            actual = target.GetOnlyOneUserInTable;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for getPrice
        ///</summary>
        [TestMethod()]
        public void getPriceTest()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            target.UsersBet[0] = 500;
            target.Users = 1;
            long expected = 500; // TODO: Initialize to an appropriate value
            long actual;
            actual = target.GetPrice;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for OnlyOneOnTable
        ///</summary>
        [TestMethod()]
        public void OnlyOneOnTableTest2()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            target.SetState(0,false);
            target.SetState(1, true);
            target.Users = 2;
            bool expected = true; // TODO: Initialize to an appropriate value
            bool actual;
            actual = target.OnlyOneOnTable();
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for ResetCardsOfUser
        ///</summary>
        [TestMethod()]
        public void ResetCardsOfUserTest()
        {
            Table target = new Table(); // TODO: Initialize to an appropriate value
            target.ResetCardsOfUser();
        }
    }
}
